<template>
  <view class="userInfo">
    <view class="menber">
      <image
        :src="
          user.headUrl
            ? user.headUrl
            : 'https://alixeu-test.oss-cn-guangzhou.aliyuncs.com/achobate/AchoBeta_logo.png'
        "
      ></image>
      <text>名称: {{ user.userName }}</text>
      <text>手机号: {{ user.userPhone }}</text>
      <text>微信: {{ user.userWxNo }}</text>
      <text>班级: {{ user.classId }}</text>
      <text>学号: {{ user.studentId }}</text>
      <text>项目经历:</text>
      <text v-for="item in user.teamList" style="margin: 0 0 50rpx 150rpx">
        {{ item.teamName }}</text
      >
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      _id: ''
    }
  },
  onLoad(data) {
    this._id = data.id
  }
}
</script>
<script setup>
import { ref, getCurrentInstance } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { getMenberSelfInfo } from '../../utils/modules/member.js'
const id = ref('')
const user = ref({})

onShow(() => {
  id.value = getCurrentInstance().data._id
  getMenberSelfInfo({
    id: id.value
  }).then((res) => {
    user.value = res.data.data
  })
})
</script>

<style lang="scss">
.userInfo {
  background: linear-gradient(to right, #87d5f2, #99a9bf);
  padding: 20rpx;
  min-height: 1650rpx;
  .menber {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    font-size: 40rpx;
    border-radius: 10rpx;
    

    image {
      margin: 50rpx auto;
      border-radius: 50%;
      width: 200rpx;
      height: 200rpx;
    }

    text {
      margin: 0 0 50rpx 100rpx;
    }
  }
}
</style>